package com.fzhucc.modules.expert.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
* @description 专家线上咨询配置表 /
* @author yyg
* @date 2023-10-20
**/
@Entity
@Data
@Table(name="tt_expert_consultation_config")
public class ExpertConsultationConfig implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "`id`")
    @ApiModelProperty(value = "id")
    private Integer id;

    @Column(name = "`expert_id`",nullable = false)
    @NotNull
    @ApiModelProperty(value = "专家id")
    private Integer expertId;

    @Column(name = "`time_slot`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "时间段")
    private String timeSlot;

    /*@Column(name = "`sort`")
    @ApiModelProperty(value = "排序")
    private Integer sort;

    @Column(name = "`is_show`",nullable = false)
    @NotNull
    @ApiModelProperty(value = "h5 小程序 是否展示 默认展示")
    private Integer isShow;*/

    @Column(name = "`is_delete`",nullable = false)
    @NotNull
    @ApiModelProperty(value = "是否假删除 默认不删除")
    private Integer isDelete;

    public void copy(ExpertConsultationConfig source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
